home *** CD-ROM | disk | FTP | other *** search
/ Champak 109 / Vol 109.iso / games / free_sty.swf / scripts / DefineSprite_164 / frame_105 / DoAction.as
Text File  |  2008-11-12  |  654b  |  30 lines

  1. var vv = 15;
  2. var mxx = _root.bg_mc.man._x;
  3. var myy = _root.bg_mc.man._y;
  4. var bxx = _root.zhu_array[_root.level][this.downn][0];
  5. var byy = _root.zhu_array[_root.level][this.downn][1];
  6. if((mxx - bxx) * (mxx - bxx) + (myy - byy) * (myy - byy) > this.vv * this.vv)
  7. {
  8.    var jj = Math.atan2(byy - myy,bxx - mxx);
  9.    this._x += this.vv * Math.cos(jj);
  10.    this._y += this.vv * Math.sin(jj);
  11. }
  12. else
  13. {
  14.    this._x = bxx;
  15.    this._y = byy;
  16.    if(this.nn51 > 6)
  17.    {
  18.       this.gotoAndPlay("Φ╖│τ┐╗l");
  19.    }
  20.    else
  21.    {
  22.       this.gotoAndPlay("Φ╖│τ┐╗d");
  23.    }
  24. }
  25. if(Key.isDown(40))
  26. {
  27.    this.nn51 = -1000000;
  28. }
  29. this.nn51 = this.nn51 + 1;
  30.